package com.ethink.warehouse.common.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ethink.warehouse.api.info.MatePurchaseCodeInfo;
import com.ethink.warehouse.api.request.MatePurchaseCodeQueryRequest;
import com.ethink.warehouse.api.response.MatePurchaseCodeGetDetailResponse;
import com.ethink.warehouse.api.response.MatePurchaseCodeQueryResponse;
import com.ethink.warehouse.common.entity.MatePurchaseCode;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 库存采购批次表 Mapper接口
 *
 * @author default
 * @date 2022-12-16
 */
@Mapper
public interface MatePurchaseCodeMapper extends BaseMapper<MatePurchaseCode> {


    MatePurchaseCodeInfo getMatePurchaseCodeByProduceCode(@Param("mateSku") String mateSku,
                                                          @Param("produceCode") String produceCode);

    List<MatePurchaseCodeInfo> getMatePurchaseCodeListByProduceCode(@Param("mateSku") String mateSku,
                                                                    @Param("excludeProduceCode") String excludeProduceCode);

    /**
     * 分页查询
     *
     * @param buildPage
     * @param request
     * @return
     */
    Page<MatePurchaseCodeQueryResponse> queryMatePurchaseCode(Page buildPage, @Param("request") MatePurchaseCodeQueryRequest request);

    /**
     * 详情
     *
     * @param id
     * @return
     */
    MatePurchaseCodeGetDetailResponse getMatePurchaseCodeById(@Param("id") Long id);


    MatePurchaseCode getByMore(@Param("mateSku") String mateSku,
                                                          @Param("produceCode") String produceCode,
                                                          @Param("costPrice") String costPrice,
                                                          @Param("createTime") String createTime);
}